#!/usr/bin/python
# -*- coding:utf-8 -*-
# -------------------------------------------------------
# @author  : 龍皓
# @time    : 2025/2/25 21:55
# @function: the script is used to do something.
# @version : 1.0.0
# -------------------------------------------------------

from PyQt6.QtWidgets import *
from ui.views import *
from ui.widgets import *
from PyQt6.QtGui import QAction
from PyQt6.QtCore import QDateTime 

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("Nexellar 主界面")
        self.setGeometry(100, 100, 600, 400)
        
        # 初始化界面组件
        self.init_ui()
        
    def init_ui(self):
        """初始化用户界面"""
        # 创建中央部件和布局
        central_widget = QWidget()
        self.setCentralWidget(central_widget)
        layout = QVBoxLayout()
        
        # 添加标签
        self.label = QLabel("欢迎使用 Nexellar", self)
        layout.addWidget(self.label)
        
        # 添加按钮
        self.button = QPushButton("点击我", self)
        self.button.clicked.connect(self.on_button_clicked)
        layout.addWidget(self.button)
        
        # 添加状态栏
        self.statusBar().showMessage("就绪")
        
        # 设置布局
        central_widget.setLayout(layout)

    def on_button_clicked(self):
        self.label.setText("按钮被点击了！")
        self.statusBar().showMessage(f"最后点击时间：{QDateTime.currentDateTime().toString()}")

